package com.laxia.model;

import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * @author weishuai
 */
@Setter
@Getter
@Accessors(chain = true)
public class PageParam {

    private static int MAX_PAGE_SIZE = 200;

    private int pageNum = 1;
    private int pageSize = 10;

    public int getPageSize() {
        return Math.min(pageSize, MAX_PAGE_SIZE);
    }

    public int getPageNum() {
        return Math.max(pageNum, 1);
    }
}
